package com.xpjhs.user.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;



import com.xpjhs.*;
import com.xpjhs.role.model.Role;

import org.apache.commons.lang.StringUtils;

@Entity(name = "com.xpjhs.user.model.User")
@Table(name = "xpjhs_user")
public class User implements Serializable {

	private static final String DEFAULT_ICON = "";// 默认头像
	/**
	 * 
	 */
	private static final long serialVersionUID = -2476917284108607779L;

	private String email;

	private String icon;

	private long id;

	private String password;

	private String phone;
		

	
	private String realName;

	private String qqName;
	private String sex;
	private String Qage;
	private String joinTime;
	private String city;
	private String content;// 个人简介
	private  List<Role> role;
	
	@OneToMany
	public List<Role> getRole() {
		return role;
	}

	public void setRole(List<Role> role) {
		this.role = role;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getQqName() {
		return qqName;
	}

	public void setQqName(String qqName) {
		this.qqName = qqName;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getQage() {
		return Qage;
	}

	public void setQage(String qage) {
		Qage = qage;
	}

	public String getJoinTime() {
		return joinTime;
	}

	public void setJoinTime(String joinTime) {
		this.joinTime = joinTime;
	}

	private Integer status = 1;// 1:正常 0：停用

	public void setStatus(Integer status) {
		this.status = status;
	}

	private String username;

	public String getEmail() {
		return email;
	}

	public String getIcon() {
		if (StringUtils.isBlank(icon)) {
			icon = DEFAULT_ICON;
		}
		return icon;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public long getId() {
		return id;
	}

	public String getPassword() {
		return password;
	}

	public String getPhone() {
		return phone;
	}

	public String getRealName() {
		return realName;
	}

	public Integer getStatus() {
		return status;
	}

	public String getUsername() {
		return username;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public void setId(long id) {
		this.id = id;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public void setUsername(String username) {
		this.username = username;
	}


	
}
